﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QtSql>
#include <QDataWidgetMapper>
#include "userdataformate.h"
#include "dataFormate.h"
#include "calibration.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    //设置当前用户
    void setUser(const ST_PatientMsg&);
signals:

    void signalsData(ST_RealParam);

protected:
    virtual void showEvent(QShowEvent *event);

    virtual void changeEvent(QEvent* event);
private slots:

    void slotSwitchPage(int index);

    void on_user_Btn_clicked();

    void on_evaluate_Btn_clicked();

    void on_train_Btn_clicked();

    void on_record_Btn_clicked();

    void on_set_Btn_clicked();

    void on_quit_Btn_clicked();

public slots:
    void slotCurrentUserChanged();

    void slotReceiveData(ST_RealParam);
private:
    void setCurrentUser();

    void setBatteryPercent(int power);

private:
    Ui::MainWindow *ui;
    ST_EvaluateData m_st_evaluateData;
    Calibration *m_Calibration;

};
#endif // MAINWINDOW_H
